<template>
  <!-- hearder -->
  <van-nav-bar
    class="nav"
    :title="title"
    left-text="返回"
    :right-text="rightText"
    :url="url"
    left-arrow
    fixed
    @click-left="onClickLeft"
    @click-right="onClickRight"
  />
</template>
<script>
export default {
  props: ['title', 'rightText', 'url'],
  data() {
    return {}
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1)
      this.$emit('onClickLeft')
    },
    onClickRight() {
      this.$router.push(this.url)
      this.$emit('onClickRight')
    }
  }
}
</script>

<style lang='css' scoped>
.nav {
  background-color: #d81e06;
}
.van-icon-arrow-left:before,.van-nav-bar__text,.van-nav-bar__title {
  color: #fff
}
</style>

